//main.cpp
#include "SerialPort.h"
int main(int argc ,char *argv[])
{   
    if (argc != 2)
    {
        std::cout << "请输入串口名！"<<std::endl;
        return -1;
    }
    

    SerialPort *serialPort = new SerialPort(argv[1]); //打开第com个串口

    serialPort->InitSerialPort(9600,8,1,'N'); //串口参数初始化

#ifdef  WRITE
    serialPort->StartWrite();
#endif

#ifdef  READ    
    serialPort->StartRead();
#endif

    while(1);
    return 0;
}

